package com.ophiux.cs.infrastructure.repositories.user;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ophiux.cs.domain.user.model.entity.CertificateType;
import com.ophiux.cs.domain.user.repositories.ICertificateTypeRepository;
import com.ophiux.cs.infrastructure.mapper.user.CertificateTypeMapper;
import com.ophiux.utils.exception.OphiuxRepositoryException;

import lombok.extern.slf4j.Slf4j;

@Repository
@Slf4j
public class CertificateTypeRepository implements ICertificateTypeRepository {
	@Autowired
	CertificateTypeMapper certificateTypeMapper;
	
	@Override
	public List<CertificateType> getInfoList() throws OphiuxRepositoryException {
		List<CertificateType> list = new ArrayList<CertificateType>();
		try {
			list= certificateTypeMapper.getInfoList();
		} catch (Exception e) {
			e.printStackTrace();
			log.info("数据库执行异常,异常信息",e);
			throw new OphiuxRepositoryException("数据库执行异常,异常信息",e);
		}
		return list;
	}
	
}
